home *** CD-ROM | disk | FTP | other *** search
/ Greatest Childrens Stories Ever Told / Greatest_Stories.iso / demos / funtown / demo.dir / 00049_Script_Scripts 5 < prev    next >
Text File  |  1994-11-08  |  4KB  |  112 lines

  1. --òòò Scripts 4
  2. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  3. on randomizeQuestions NOQ
  4.   global mode, mode.1, MS, QL, WQ, availableQuestions, QC, TR
  5.   global NQ, RD, DQL, DAQ, NS, TCN, FTM
  6.   CheckNumbers
  7.   set NOQ = TCN
  8.   if not FTM then set NS = 0
  9.   set RD=0
  10.   set QC=the text of cast ( MS& " Questions" )
  11.   set availableQuestions=the number of lines in QC
  12.   if voidP ( NOQ ) then set NOQ=5
  13.   if mode.1 then set NOQ=availableQuestions
  14.   set QL=""
  15.   set CNL=""
  16.   put WQ into QuestionHolder
  17.   set WQ=1
  18.   set NQ=NOQ
  19.   repeat with x=1 to availableQuestions 
  20.     set QL=QL& ","& x
  21.   end repeat
  22.   delete char 1 of QL 
  23.   if not ( mode.1 ) then 
  24.     repeat with x=1 to availableQuestions 
  25.       set itemX=item ( x ) of QL
  26.       set itemRandom=random ( availableQuestions )
  27.       put item ( itemRandom ) of QL into item ( x ) of QL
  28.       put itemX into item ( itemRandom ) of QL
  29.     end repeat
  30.     set RD=1
  31.     set WQ=1
  32.     set NQ = 5
  33.     checkRandomOrder
  34.     if FTM then 
  35.       set FTM = false
  36.       set WQ = QuestionHolder
  37.     else
  38.       set WQ = 1
  39.     end if
  40.     repeat with x=2 to 31
  41.       set the locV of sprite x=1000
  42.     end repeat 
  43.     unloadCast
  44.     exit
  45.   end if
  46. end
  47. --¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
  48. on CheckRandomOrder
  49.   global mode, mode.1, MS, QL, WQ, availableQuestions, QC, TR
  50.   global NQ, RD, DQL, DAQ, NS, TCN, NOQ, CNL
  51.   repeat with x=1 to NOQ
  52.     set duplicateNumber=0
  53.     set WQ=value ( item ( x ) of QL )
  54.     if duplicateNumber=0 then
  55.       set spriteName=item 1 of line ( WQ ) of QC 
  56.       if CNL contains spriteName then set duplicateNumber=1
  57.       else
  58.         if not ( spriteName contains "òNo Patch" ) then set CNL=CNL& spriteName& ","
  59.         set CNL=CNL& spriteName2& ","
  60.       end if
  61.     else
  62.       if not ( spriteName contains "òNo Patch" ) then set CNL=CNL& spriteName& ","  
  63.     end if
  64.     if duplicateNumber=1 then
  65.       delete item ( x ) of QL 
  66.       set x=x-1
  67.       set availableQuestions=availableQuestions-1
  68.       if NOQ>availableQuestions then 
  69.         set QL="NOQ>availableQuestions"
  70.         randomizeQuestions NOQ
  71.         exit 
  72.       end if
  73.     end if
  74.   end repeat
  75.   if char 1 of QL="," then delete char 1 of QL 
  76.   set lastChar=char ( the number of chars in QL ) of QL
  77.   if lastChar="," then delete char ( the number of chars in QL ) of QL
  78.   put "Random list of "& NOQ& " numbers: "& QL
  79. end                                         
  80. --¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
  81.  
  82. on doWindow
  83.   set the Rect of Window "Win" = rect(the StageLeft+120, the StageTop + 30, the StageLeft + 408, the StageTop + 218)
  84.   set the titleVisible of window "Win" = False
  85.   set the modal of window "Win" to true
  86.   open Window "Win"
  87.   tell window "Win" to go label ( "Start" )
  88.   pause
  89. end
  90. --¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
  91.  
  92. on doWindow2
  93.   set the Rect of Window "Win" = rect(the StageLeft+120, the StageTop + 30, the StageLeft + 408, the StageTop + 218)
  94.   set the titleVisible of window "Win" = False
  95.   set the modal of window "Win" to true
  96.   open Window "Win"
  97.   tell window "Win" to go label ( "help" )
  98.   pause
  99. end
  100. --¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
  101.  
  102. on doWindow3
  103.   set the Rect of Window "Win" = rect(the StageLeft+120, the StageTop + 30, the StageLeft + 408, the StageTop + 218)
  104.   set the titleVisible of window "Win" = False
  105.   set the modal of window "Win" to true
  106.   open Window "Win"
  107.   tell window "Win" to go label ( "map" )
  108.   puppetsound 0
  109.   pause
  110. end
  111.  
  112.